/**
 * Created by Ji.wenjiang on 2016/8/31.
 */


angular.module('inspinia')
  .controller('payMoneyCtrl',function ($scope,users,$state) {
    init();
    function init() {

      $scope.search = {};
      if (localStorage.getItem('regObj')) {
        $scope.patientList = JSON.parse(localStorage.getItem('regObj'));
        $.each(users, function (i, val) {
          $scope.patientList.push(val);
        })
        $scope.persons = $scope.patientList;
        setTimeout(function () {
          $('#mainTable').trigger('footable_redraw');
        }, 100)
      } else {
        $scope.patientList = [];
        $.each(users, function (i, val) {
          $scope.patientList.push(val);
        })
        $scope.persons = $scope.patientList;
        setTimeout(function () {
          $('#mainTable').trigger('footable_redraw');
        }, 100)
      }
    }
    //
    $scope.payMoney=function (person) {
      localStorage.setItem('payMoneyMsg',JSON.stringify(person));
      $state.go('index.payMoneyDetail');
    }
  })
